#include <bits/stdc++.h>
using namespace std;
#define PI 3.1415926
#define   SQUARE(x) ((x)*(x))
//double SQUARE(double x) { return x*x;}

int main()
{
	int x, y ;
	double x2;
	char c;
	scanf("%d",  &x);

	if(     0 == x % 3 && 0 == x % 5 && 0 == x % 7) printf("3 5 7");
	else if(0 == x % 3 && 0 == x % 5              ) printf("3 5");
	else if(0 == x % 3 && 0 == x % 7              ) printf("3 7");
	else if(0 == x % 5 && 0 == x % 7              ) printf("5 7");
	else if(0 == x % 3 || 0 == x % 5 || 0 == x % 7) printf("%d", 0 == x % 3 ? 3 : ( 0 == x % 5 ? 5 : 7));
  else printf("n");

  return 0;
}
